<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src/views/modules/sys/role.vue</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="..\..\..\..\prettify.css" />
    <link rel="stylesheet" href="..\..\..\..\base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(..\..\..\..\sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="..\..\..\..\index.html">All files</a> / <a href="index.html">src/views/modules/sys</a> role.vue
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/57</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/36</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/26</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/42</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178</td><td class="line-coverage quiet"><span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&lt;<span class="cstat-no" title="statement not covered" >t<span class="fstat-no" title="function not covered" >em</span>plate&gt;</span>
  &lt;div class="mod-role"&gt;
    &lt;el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"&gt;
<span class="cstat-no" title="statement not covered" >      &lt;el-form-item&gt;</span>
        &lt;el-input v-model="dataForm.roleName" placeholder="角色名称" clearable&gt;&lt;/el-input&gt;
      &lt;/el-form-item&gt;
      &lt;el-form-item&gt;
        &lt;el-button @cli<span class="cstat-no" title="statement not covered" >ck="getDataList()"&gt;查询&lt;/el-button</span>&gt;
        &lt;el-button v-if="isAuth('sys:role:save')" type="primary" @click="addOrUpdateHandle()"&gt;新增&lt;/el-button&gt;
        &lt;el-button v-if=<span class="cstat-no" title="statement not covered" >"isAuth('sys:role:delete')" type="danger"</span> @click="deleteHandle()" :disabled="dataListSelections.length &lt;= 0"&gt;批量删除&lt;/el-button&gt;
      &lt;/el-form-item&gt;
    &lt;/el-<span class="fstat-no" title="function not covered" >form&gt;<span class="cstat-no" title="statement not covered" ></span></span>
    &lt;el-table
<span class="cstat-no" title="statement not covered" >      :data="dataList"</span>
      border<span class="fstat-no" title="function not covered" ></span>
<span class="cstat-no" title="statement not covered" >      v-loading="dataListLoading"</span>
      @selection-change="selectionChangeHandle"
      style="width: 100%;"&gt;
      &lt;el-table-column
        type="selection"
        header-align="center"
        align="center"
        width="50"&gt;
      &lt;/el-table-column&gt;
      &lt;el-table-column
        prop="roleId"
        header-align="center"
        align="center"
        width="80"
        label="ID"&gt;
      &lt;/el-table-column&gt;
      &lt;el-table-column
        prop="roleName<span class="fstat-no" title="function not covered" >"</span>
<span class="cstat-no" title="statement not covered" >        header-align="ce</span>nter"
        align="center"
        label="角色名称"&gt;
      &lt;/el-table-column&gt;
      &lt;el-table-column
        prop="remark"<span class="fstat-no" title="function not covered" ></span>
        header-ali<span class="cstat-no" title="statement not covered" >gn="c</span>enter"
        align="center"
<span class="cstat-no" title="statement not covered" >        label="备注"&gt;</span>
<span class="cstat-no" title="statement not covered" >      &lt;/el-table-column&gt;</span>
      &lt;el-table-column
        prop="createTime"
        header-align="center"
        align="center"
        width="180"
        label="创建时间"&gt;
      &lt;/el-table-column&gt;
      &lt;el-tabl<span class="fstat-no" title="function not covered" >e-</span>column
        fixed="righ<span class="cstat-no" title="statement not covered" >t"</span>
        header-align="center"
<span class="cstat-no" title="statement not covered" >        align="center"</span>
        wi<span class="cstat-no" title="statement not covered" >dth="150"</span>
        la<span class="cstat-no" title="statement not covered" >bel="操作"&gt;</span>
        &lt;template slot-scope="scope"&gt;
<span class="cstat-no" title="statement not covered" >          &lt;el-button v-if="isAu</span>th('sys:role:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.roleId)"&gt;修改&lt;/el-button&gt;
<span class="cstat-no" title="statement not covered" >          &lt;el-button v-if="isAu</span>th('sys:role:delete')" type="text" size="small" @click="deleteHandle(scope.row.roleId)"&gt;删除&lt;/el-button&gt;
        &lt;/template&gt;
      &lt;/<span class="cstat-no" title="statement not covered" >el-table-column&gt;</span>
    &lt;/el-table&gt;
    &lt;el-pagination
      @size-change="sizeChangeHandle"
      @current-change="currentChangeHandle"
      :current-page="pageIndex"<span class="fstat-no" title="function not covered" ></span>
<span class="cstat-no" title="statement not covered" >      :page-sizes="[10, 20,</span> 50, 100]"
<span class="cstat-no" title="statement not covered" >      :page-size="pageSize</span>"
<span class="cstat-no" title="statement not covered" >      :total="totalPage"</span>
      layout="total, sizes, prev, pager, next, jumper"&gt;
    &lt;/el-pagination&gt;
    &lt;!-- 弹窗, 新增 / 修改 --&gt;
    &lt;add-or-update v-if="addOrUpda<span class="fstat-no" title="function not covered" >teVisible" ref="addO</span>rUpdate" @refreshDataList="getDataList"&gt;&lt;/add-or-update&gt;
  &lt;/di<span class="cstat-no" title="statement not covered" >v&gt;</span>
&lt;/temp<span class="cstat-no" title="statement not covered" >late&gt;</span>
&nbsp;
&lt;script&gt;
  import AddOrUpdate from './role-add-or-update'
  export default {<span class="fstat-no" title="function not covered" ></span>
    da<span class="cstat-no" title="statement not covered" >ta () {</span>
      return {
        dataForm: {
          roleName: ''
        },<span class="fstat-no" title="function not covered" ></span>
        dataList: [<span class="cstat-no" title="statement not covered" >],</span>
        pageIndex: 1,
<span class="cstat-no" title="statement not covered" >        pageSize: 10,</span>
<span class="cstat-no" title="statement not covered" >        totalPage: 0,<span class="fstat-no" title="function not covered" ></span></span>
<span class="cstat-no" title="statement not covered" >        dataListLoading: false,</span>
        dataListSelections: [],
        addOrUpdateVisible: false
      }
    },
    components: {<span class="fstat-no" title="function not covered" ></span>
      AddOrUpdate<span class="cstat-no" title="statement not covered" ></span>
    },
    activated ()<span class="cstat-no" title="statement not covered" > {<span class="fstat-no" title="function not covered" ></span></span>
      th<span class="cstat-no" title="statement not covered" >is.getDataList()</span>
    },
    me<span class="cstat-no" title="statement not covered" >thods: {</span>
      // 获取数据列表
      getDataList () {
        this.dataListLoading = true
        this.$<span class="fstat-no" title="function not covered" >ht</span>tp({
<span class="cstat-no" title="statement not covered" >          url: this.$http.adornUrl('/sys/role/list'),</span>
          method: 'get',
          params: this.$http.adornParams({
            'page': this.pageIndex,
            'lim<span class="fstat-no" title="function not covered" >it</span>': this.pageSize,
            'roleName<span class="cstat-no" title="statement not covered" >': this.dat</span>aForm.roleName
          })
        })<span class="cstat-no" title="statement not covered" >.then(({data}) =&gt; {</span>
          if<span class="cstat-no" title="statement not covered" > (data &amp;&amp; data.code === 0) {</span>
            this.dataList = data.page.list
            this.totalPage = data.page.totalCount
          } else {
            this.dataList = []<span class="fstat-no" title="function not covered" ></span>
            this<span class="cstat-no" title="statement not covered" >.totalPage = 0</span>
          }
          this.dataListLoading = false
        })
      },<span class="cstat-no" title="statement not covered" ></span>
      // 每页数
      sizeChangeHandle (val) {
        this.pa<span class="fstat-no" title="function not covered" >ge</span>Size = val
        this.pageIndex = 1
        this.getDataList()
      },
      // 当前页
      currentChangeHandle (val) {
        this.pageIndex = val
        this.getDataList()
      },
      // 多选
      selectionChangeHandle (val) {
        this.dataListSelections = val
      },
      // 新增 / 修改
      addOrUpdateHandle (id) {
        this.addOrUpdateVisible = true
        this.$nextTick(() =&gt; {
          this.$refs.addOrUpdate.init(id)
        })
      },
      // 删除
      deleteHandle (id) {
        var ids = id ? [id] : this.dataListSelections.map(item =&gt; {
          return item.roleId
        })
        this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() =&gt; {
          this.$http({
            url: this.$http.adornUrl('/sys/role/delete'),
            method: 'post',
            data: this.$http.adornData(ids, false)
          }).then(({data}) =&gt; {
            if (data &amp;&amp; data.code === 0) {
              this.$message({
                message: '操作成功',
                type: 'success',
                duration: 1500,
                onClose: () =&gt; {
                  this.getDataList()
                }
              })
            } else {
              this.$message.error(data.msg)
            }
          })
        }).catch(() =&gt; {})
      }
    }
  }
&lt;/script&gt;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Thu Sep 20 2018 10:14:21 GMT+0800 (中国标准时间)
</div>
</div>
<script src="..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="..\..\..\..\sorter.js"></script>
</body>
</html>
